<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <button>点击</button>

    <script>

        // 创建超链接，不会被拦截
        function createSuperLabel(url, id) {
            let a = document.createElement("a");
            a.setAttribute("href", url);
            a.setAttribute("target", "_blank");
            a.setAttribute("id", id);
            // 防止反复添加
            if (!document.getElementById(id)) {
                document.body.appendChild(a);
            }
            a.click();
            a.remove();
        }


        document.querySelector('button').addEventListener('click', function () {
            createSuperLabel('https://baidu.com');
        });

    </script>
</body>
</html>
